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

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

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

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

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

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

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

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

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

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

b.y = i
b.v = i
b.o = c
b.z = l
l.t = c
i.u = h
i.t = k
i.y = c
i.z = g
n.z = i
n.o = c
n.u = d
n.q = g
h.u = i
h.t = l
h.y = c
h.z = g
d.y = h
d.v = h
d.o = c
d.z = l
a.t = n
g.y = h
g.v = h
g.o = c
g.z = l
c.z = i
c.o = n
c.u = g
c.q = b
k.t = c
assert k.t.z.t.t.q.o.z.txt == "i"