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

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

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

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

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

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

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

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

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

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

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