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

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

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

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

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

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

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

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

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

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

j.z = k
j.o = n
j.v = l
j.r = c
g.r = c
g.p = c
g.q = j
g.t = i
l.o = h
l.v = g
l.w = i
h.x = j
h.t = k
h.u = k
n.o = k
n.v = m
n.w = c
m.r = i
m.q = c
m.t = j
m.p = j
c.z = h
c.o = l
c.v = l
c.r = j
a.r = c
a.t = c
a.q = i
a.p = j
i.z = h
i.o = n
i.v = n
i.r = c
k.x = c
k.t = h
k.u = h
assert a.p.r.v.o.txt == "h"