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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: C = None
        self.txt = txt

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

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

h.o = k
h.z = e
n.v = j
n.y = e
k.u = j
k.v = c
a.w = h
a.r = j
a.x = j
m.v = h
m.y = e
e.w = j
e.x = j
e.r = h
c.u = h
c.v = k
i.v = h
i.y = e
j.o = k
j.z = e
assert n.y.x.o.u.z.r.txt == "h"