class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.s: D = None
        self.z: F = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: C = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: A = None
        self.r: C = None
        self.v: D = None
        self.z: E = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
n = D("n")
e = E("e")
a = F("a")
d = C("d")
c = E("c")

b.x = k
b.q = e
b.t = e
b.s = n
b.z = a
i.q = b
k.s = a
k.x = d
k.z = n
n.o = b
n.y = b
e.p = n
e.t = n
e.o = i
e.r = a
e.q = c
e.v = d
a.u = b
a.t = b
a.r = k
a.v = n
a.z = c
d.s = a
d.x = k
d.z = n
c.p = n
c.t = n
c.o = i
c.r = a
c.q = e
c.v = d
assert c.r.u.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.s: D = None
        self.z: F = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: C = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: A = None
        self.r: C = None
        self.v: D = None
        self.z: E = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
n = D("n")
e = E("e")
a = F("a")
d = C("d")
c = E("c")

b.x = k
b.q = e
b.t = e
b.s = n
b.z = a
i.q = b
k.s = a
k.x = d
k.z = n
n.o = b
n.y = b
e.p = n
e.t = n
e.o = i
e.r = a
e.q = c
e.v = d
a.u = b
a.t = b
a.r = k
a.v = n
a.z = c
d.s = a
d.x = k
d.z = n
c.p = n
c.t = n
c.o = i
c.r = a
c.q = e
c.v = d
assert c.r.u.q.q.q.q.txt == "c"