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

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

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

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

m = A("m")
b = B("b")
j = C("j")
c = D("c")
d = A("d")
n = B("n")
k = D("k")
h = D("h")
l = B("l")

m.y = h
b.o = n
b.u = j
b.r = c
b.w = h
j.x = m
c.x = m
c.s = k
c.v = j
c.w = j
d.y = c
n.o = b
n.u = j
n.r = h
n.w = c
k.x = d
k.s = h
k.v = j
k.w = j
h.x = d
h.s = c
h.v = j
h.w = j
l.o = n
l.u = j
l.r = h
l.w = c
assert j.x.y.s.x.y.v.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

m = A("m")
b = B("b")
j = C("j")
c = D("c")
d = A("d")
n = B("n")
k = D("k")
h = D("h")
l = B("l")

m.y = h
b.o = n
b.u = j
b.r = c
b.w = h
j.x = m
c.x = m
c.s = k
c.v = j
c.w = j
d.y = c
n.o = b
n.u = j
n.r = h
n.w = c
k.x = d
k.s = h
k.v = j
k.w = j
h.x = d
h.s = c
h.v = j
h.w = j
l.o = n
l.u = j
l.r = h
l.w = c
assert j.x.y.s.x.y.v.x.y.txt == "h"