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

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

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

c = A("c")
l = B("l")
k = C("k")
e = B("e")
n = A("n")
a = C("a")
j = B("j")
d = B("d")
h = A("h")
m = B("m")

c.r = d
c.x = k
l.u = k
l.t = k
k.v = a
k.w = a
e.u = k
e.t = k
n.r = l
n.x = k
a.v = k
a.w = k
j.u = k
j.t = a
d.u = k
d.t = a
h.r = e
h.x = a
m.u = k
m.t = a
assert n.x.w.v.w.v.w.w.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
k = C("k")
e = B("e")
n = A("n")
a = C("a")
j = B("j")
d = B("d")
h = A("h")
m = B("m")

c.r = d
c.x = k
l.u = k
l.t = k
k.v = a
k.w = a
e.u = k
e.t = k
n.r = l
n.x = k
a.v = k
a.w = k
j.u = k
j.t = a
d.u = k
d.t = a
h.r = e
h.x = a
m.u = k
m.t = a
assert n.x.w.v.w.v.w.w.w.v.txt == "k"