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

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

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

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

n = A("n")
m = B("m")
b = C("b")
e = D("e")
f = D("f")
h = C("h")
k = B("k")
l = A("l")
a = D("a")

n.s = l
n.t = k
m.o = n
m.u = h
m.r = k
b.w = n
b.t = n
b.o = m
b.v = e
e.v = m
e.r = b
e.x = h
e.y = k
f.v = k
f.y = k
f.r = b
f.x = h
h.w = l
h.t = l
h.o = m
h.v = f
k.o = n
k.u = b
k.r = m
l.s = n
l.t = k
a.v = m
a.y = m
a.r = b
a.x = b
assert h.o.r.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: B = None
        self.txt = txt

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

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

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

n = A("n")
m = B("m")
b = C("b")
e = D("e")
f = D("f")
h = C("h")
k = B("k")
l = A("l")
a = D("a")

n.s = l
n.t = k
m.o = n
m.u = h
m.r = k
b.w = n
b.t = n
b.o = m
b.v = e
e.v = m
e.r = b
e.x = h
e.y = k
f.v = k
f.y = k
f.r = b
f.x = h
h.w = l
h.t = l
h.o = m
h.v = f
k.o = n
k.u = b
k.r = m
l.s = n
l.t = k
a.v = m
a.y = m
a.r = b
a.x = b
assert h.o.r.o.s.txt == "l"