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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: F = None
        self.u: C = None
        self.r: B = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: F = None
        self.u: C = None
        self.r: B = None
        self.o: A = None
        self.txt = txt

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

f.x = g
l.t = i
l.r = i
l.p = e
l.y = f
l.q = m
b.u = f
b.o = f
b.w = i
i.u = b
i.x = b
i.w = l
i.p = l
e.y = b
e.z = b
e.u = f
e.q = f
e.x = i
e.t = c
g.p = b
g.u = b
g.z = j
g.r = l
g.o = f
j.p = b
j.u = b
j.z = g
j.r = l
j.o = f
m.y = b
m.z = b
m.u = f
m.q = f
m.x = i
m.t = e
c.y = b
c.z = b
c.u = f
c.q = f
c.x = i
c.t = m
assert c.t.y.o.x.txt == "g"