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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

f = A("f")
c = B("c")
e = C("e")
b = D("b")
g = E("g")
a = D("a")
i = E("i")

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

f = A("f")
c = B("c")
e = C("e")
b = D("b")
g = E("g")
a = D("a")
i = E("i")

f.z = g
c.q = g
e.o = c
b.x = c
b.p = c
g.v = i
g.u = b
a.x = c
a.p = c
i.v = g
i.u = b
assert a.x.q.u.p.txt == "c"