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

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

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

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

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

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

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

j.o = e
j.p = e
j.r = e
j.y = n
a.o = c
b.y = j
m.u = e
m.p = b
m.x = j
m.y = j
m.s = c
c.w = a
c.r = a
c.q = d
c.z = e
c.x = e
e.s = a
e.w = m
e.u = j
e.r = j
e.y = d
n.u = e
n.p = b
n.x = j
n.y = j
n.s = c
d.o = c
assert a.o.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.y: D = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

j.o = e
j.p = e
j.r = e
j.y = n
a.o = c
b.y = j
m.u = e
m.p = b
m.x = j
m.y = j
m.s = c
c.w = a
c.r = a
c.q = d
c.z = e
c.x = e
e.s = a
e.w = m
e.u = j
e.r = j
e.y = d
n.u = e
n.p = b
n.x = j
n.y = j
n.s = c
d.o = c
assert a.o.r.o.txt == "c"