class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: B = None
        self.o: C = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: E = None
        self.t: A = None
        self.u: B = None
        self.r: A = None
        self.txt = txt

b = A("b")
f = B("f")
j = C("j")
c = D("c")
e = E("e")
a = F("a")
l = E("l")

b.q = a
b.r = j
f.u = c
j.o = e
j.x = f
c.r = a
c.z = e
c.y = l
e.y = f
e.u = f
e.w = f
e.o = j
a.q = c
a.s = l
a.t = b
a.r = b
a.u = f
l.y = f
l.u = f
l.w = f
l.o = j
assert c.z.o.x.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: B = None
        self.o: C = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: E = None
        self.t: A = None
        self.u: B = None
        self.r: A = None
        self.txt = txt

b = A("b")
f = B("f")
j = C("j")
c = D("c")
e = E("e")
a = F("a")
l = E("l")

b.q = a
b.r = j
f.u = c
j.o = e
j.x = f
c.r = a
c.z = e
c.y = l
e.y = f
e.u = f
e.w = f
e.o = j
a.q = c
a.s = l
a.t = b
a.r = b
a.u = f
l.y = f
l.u = f
l.w = f
l.o = j
assert c.z.o.x.u.z.txt == "e"