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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: E = None
        self.o: C = None
        self.p: F = None
        self.q: C = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: B = None
        self.t: B = None
        self.u: A = None
        self.z: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: E = None
        self.o: C = None
        self.p: F = None
        self.q: C = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: B = None
        self.t: B = None
        self.u: A = None
        self.z: A = None
        self.txt = txt

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

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