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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: D = None
        self.t: D = None
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: D = None
        self.t: D = None
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: D = None
        self.txt = txt

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

k.o = h
k.t = h
k.v = i
k.z = j
l.q = k
l.u = j
l.t = c
l.r = c
i.t = n
i.x = n
i.y = a
d.s = h
d.u = j
n.t = a
n.x = a
n.y = i
a.t = n
a.x = n
a.y = i
f.q = k
f.u = j
f.t = c
f.r = d
h.o = k
h.t = k
h.v = n
h.z = c
c.s = k
c.u = d
j.s = k
j.u = c
assert n.x.y.x.t.t.y.txt == "i"