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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: C = None
        self.s: A = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: B = None
        self.p: C = None
        self.r: B = None
        self.s: A = None
        self.v: C = None
        self.txt = txt

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

b = A("b")
f = B("f")
a = C("a")
e = D("e")
g = E("g")
l = F("l")
d = E("d")

b.t = d
b.p = f
f.w = a
f.p = a
f.s = b
f.z = b
a.x = b
a.v = b
e.w = f
g.o = f
g.t = f
g.r = f
g.p = a
g.v = a
g.s = b
l.p = b
l.w = f
l.r = e
d.o = f
d.t = f
d.r = f
d.p = a
d.v = a
d.s = b
assert d.t.s.t.s.p.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: C = None
        self.s: A = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: B = None
        self.p: C = None
        self.r: B = None
        self.s: A = None
        self.v: C = None
        self.txt = txt

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

b = A("b")
f = B("f")
a = C("a")
e = D("e")
g = E("g")
l = F("l")
d = E("d")

b.t = d
b.p = f
f.w = a
f.p = a
f.s = b
f.z = b
a.x = b
a.v = b
e.w = f
g.o = f
g.t = f
g.r = f
g.p = a
g.v = a
g.s = b
l.p = b
l.w = f
l.r = e
d.o = f
d.t = f
d.r = f
d.p = a
d.v = a
d.s = b
assert d.t.s.t.s.p.z.p.txt == "f"