class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: C = None
        self.u: D = None
        self.q: B = None
        self.x: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: C = None
        self.p: E = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: F = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: F = None
        self.x: B = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

e = A("e")
f = B("f")
l = C("l")
m = D("m")
n = E("n")
k = F("k")
j = A("j")
a = E("a")

e.o = n
e.p = l
e.u = m
e.q = f
e.x = j
f.o = j
f.u = l
f.p = a
f.v = m
l.t = n
l.o = k
l.v = f
m.t = f
m.p = a
n.u = f
n.x = f
n.z = k
n.r = k
k.p = j
j.o = a
j.p = l
j.u = m
j.q = f
j.x = e
a.u = f
a.x = f
a.z = k
a.r = k
assert f.p.x.p.x.u.o.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: C = None
        self.u: D = None
        self.q: B = None
        self.x: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: C = None
        self.p: E = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: F = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: F = None
        self.x: B = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

e = A("e")
f = B("f")
l = C("l")
m = D("m")
n = E("n")
k = F("k")
j = A("j")
a = E("a")

e.o = n
e.p = l
e.u = m
e.q = f
e.x = j
f.o = j
f.u = l
f.p = a
f.v = m
l.t = n
l.o = k
l.v = f
m.t = f
m.p = a
n.u = f
n.x = f
n.z = k
n.r = k
k.p = j
j.o = a
j.p = l
j.u = m
j.q = f
j.x = e
a.u = f
a.x = f
a.z = k
a.r = k
assert f.p.x.p.x.u.o.p.q.txt == "f"