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

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

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

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

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

g.z = i
g.t = i
g.y = n
a.s = e
a.v = i
a.r = n
c.y = i
c.u = a
c.x = e
n.o = a
n.z = a
n.p = i
n.q = e
i.o = a
i.z = a
i.p = n
i.q = e
f.z = n
f.y = n
f.t = i
e.y = n
e.u = a
e.x = c
assert i.z.s.x.y.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.y: D = None
        self.txt = txt

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

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

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

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

g.z = i
g.t = i
g.y = n
a.s = e
a.v = i
a.r = n
c.y = i
c.u = a
c.x = e
n.o = a
n.z = a
n.p = i
n.q = e
i.o = a
i.z = a
i.p = n
i.q = e
f.z = n
f.y = n
f.t = i
e.y = n
e.u = a
e.x = c
assert i.z.s.x.y.p.o.txt == "a"