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

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

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

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

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

h.v = k
h.w = i
k.u = f
i.x = f
i.o = j
i.z = n
b.o = l
b.s = l
b.q = k
b.z = k
j.o = i
j.s = i
j.q = k
j.z = k
m.v = k
m.w = i
f.o = l
f.s = l
f.q = k
f.z = k
g.x = j
g.o = j
g.z = l
n.x = f
n.o = f
n.z = g
l.x = j
l.o = f
l.z = i
assert i.o.q.u.s.z.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: C = None
        self.txt = txt

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

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

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

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

h.v = k
h.w = i
k.u = f
i.x = f
i.o = j
i.z = n
b.o = l
b.s = l
b.q = k
b.z = k
j.o = i
j.s = i
j.q = k
j.z = k
m.v = k
m.w = i
f.o = l
f.s = l
f.q = k
f.z = k
g.x = j
g.o = j
g.z = l
n.x = f
n.o = f
n.z = g
l.x = j
l.o = f
l.z = i
assert i.o.q.u.s.z.z.o.txt == "f"