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

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

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

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

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

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

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

b.p = f
b.t = f
i.o = a
i.z = c
f.q = b
f.x = b
f.v = e
f.p = l
f.y = l
c.z = i
a.p = c
a.z = f
k.u = e
k.o = b
l.p = c
l.z = f
e.u = k
e.o = b
assert c.z.o.p.z.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

b.p = f
b.t = f
i.o = a
i.z = c
f.q = b
f.x = b
f.v = e
f.p = l
f.y = l
c.z = i
a.p = c
a.z = f
k.u = e
k.o = b
l.p = c
l.z = f
e.u = k
e.o = b
assert c.z.o.p.z.o.z.txt == "f"