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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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