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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: A = None
        self.t: B = None
        self.y: A = None
        self.txt = txt

c = A("c")
l = B("l")
k = C("k")
n = D("n")
g = C("g")
m = B("m")
a = C("a")
d = B("d")
j = C("j")
i = C("i")

c.z = k
c.v = m
l.z = d
l.o = j
l.u = n
l.r = n
k.p = n
n.q = i
n.s = c
n.y = c
n.t = l
g.p = n
m.z = l
m.o = i
m.u = n
m.r = n
a.p = n
d.z = l
d.o = g
d.u = n
d.r = n
j.p = n
i.p = n
assert n.q.p.s.z.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: A = None
        self.t: B = None
        self.y: A = None
        self.txt = txt

c = A("c")
l = B("l")
k = C("k")
n = D("n")
g = C("g")
m = B("m")
a = C("a")
d = B("d")
j = C("j")
i = C("i")

c.z = k
c.v = m
l.z = d
l.o = j
l.u = n
l.r = n
k.p = n
n.q = i
n.s = c
n.y = c
n.t = l
g.p = n
m.z = l
m.o = i
m.u = n
m.r = n
a.p = n
d.z = l
d.o = g
d.u = n
d.r = n
j.p = n
i.p = n
assert n.q.p.s.z.p.s.txt == "c"