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

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

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

c = A("c")
a = B("a")
l = C("l")
j = A("j")
f = A("f")
b = B("b")
h = C("h")

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

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

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

c = A("c")
a = B("a")
l = C("l")
j = A("j")
f = A("f")
b = B("b")
h = C("h")

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