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

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

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

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

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

l.o = b
l.z = f
l.r = h
k.u = h
k.z = b
h.s = b
h.t = b
g.t = k
g.x = i
g.v = i
g.u = f
b.t = m
b.x = l
b.u = g
b.v = i
m.u = h
m.z = g
f.t = k
f.x = i
f.u = b
f.v = l
i.o = b
i.z = g
i.r = h
assert f.t.u.s.x.r.s.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: D = None
        self.r: C = None
        self.txt = txt

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

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

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

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

l.o = b
l.z = f
l.r = h
k.u = h
k.z = b
h.s = b
h.t = b
g.t = k
g.x = i
g.v = i
g.u = f
b.t = m
b.x = l
b.u = g
b.v = i
m.u = h
m.z = g
f.t = k
f.x = i
f.u = b
f.v = l
i.o = b
i.z = g
i.r = h
assert f.t.u.s.x.r.s.t.u.txt == "h"