class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: F = None
        self.y: B = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: C = None
        self.z: F = None
        self.o: F = None
        self.txt = txt

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

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

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

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

g = A("g")
f = B("f")
d = C("d")
c = D("c")
b = E("b")
k = F("k")

g.t = k
g.q = k
g.y = f
g.z = b
f.s = g
f.q = d
f.z = k
f.o = k
d.y = k
d.s = k
d.r = c
d.u = b
c.r = d
c.x = d
c.o = k
c.s = k
b.p = c
b.o = d
k.r = c
k.p = b
k.x = d
k.o = g
assert k.o.y.s.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: F = None
        self.y: B = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: C = None
        self.z: F = None
        self.o: F = None
        self.txt = txt

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

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

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

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

g = A("g")
f = B("f")
d = C("d")
c = D("c")
b = E("b")
k = F("k")

g.t = k
g.q = k
g.y = f
g.z = b
f.s = g
f.q = d
f.z = k
f.o = k
d.y = k
d.s = k
d.r = c
d.u = b
c.r = d
c.x = d
c.o = k
c.s = k
b.p = c
b.o = d
k.r = c
k.p = b
k.x = d
k.o = g
assert k.o.y.s.t.x.txt == "d"