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

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

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

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

k = A("k")
a = B("a")
j = C("j")
g = D("g")
f = D("f")
h = B("h")
e = B("e")
c = C("c")
m = A("m")
i = D("i")

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

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

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

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

k = A("k")
a = B("a")
j = C("j")
g = D("g")
f = D("f")
h = B("h")
e = B("e")
c = C("c")
m = A("m")
i = D("i")

k.t = i
k.z = m
k.q = m
k.x = m
a.v = e
a.o = k
j.w = m
j.q = m
j.r = g
j.s = c
g.y = i
g.x = j
g.u = e
g.v = f
f.y = i
f.v = i
f.x = c
f.u = a
h.v = a
h.o = m
e.v = a
e.o = k
c.w = k
c.q = k
c.r = g
c.s = j
m.t = g
m.z = k
m.q = k
m.x = k
i.y = f
i.x = j
i.u = e
i.v = g
assert g.v.u.o.t.y.v.v.u.o.t.txt == "i"