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

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

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

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

j = A("j")
e = B("e")
a = C("a")
m = D("m")
c = B("c")
g = C("g")
l = D("l")
f = C("f")
h = B("h")
b = A("b")

j.r = f
e.x = b
e.w = c
e.u = m
a.q = m
m.v = j
m.u = j
m.w = l
m.t = h
c.x = j
c.w = h
c.u = m
g.q = l
l.v = b
l.u = b
l.w = m
l.t = e
f.q = m
h.x = b
h.w = e
h.u = l
b.r = f
assert c.u.w.w.t.x.r.q.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

j = A("j")
e = B("e")
a = C("a")
m = D("m")
c = B("c")
g = C("g")
l = D("l")
f = C("f")
h = B("h")
b = A("b")

j.r = f
e.x = b
e.w = c
e.u = m
a.q = m
m.v = j
m.u = j
m.w = l
m.t = h
c.x = j
c.w = h
c.u = m
g.q = l
l.v = b
l.u = b
l.w = m
l.t = e
f.q = m
h.x = b
h.w = e
h.u = l
b.r = f
assert c.u.w.w.t.x.r.q.t.u.txt == "l"