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

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: F = None
        self.t: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: F = None
        self.t: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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