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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: D = None
        self.w: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: D = None
        self.w: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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