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

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

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

h = A("h")
i = B("i")
k = C("k")
e = A("e")
j = A("j")
d = A("d")
f = A("f")
b = C("b")
l = B("l")
c = B("c")

h.s = i
h.y = e
h.u = k
i.w = k
i.t = c
i.x = b
k.v = b
k.r = f
e.s = c
e.y = f
e.u = b
j.s = c
j.y = f
j.u = b
d.s = c
d.y = j
d.u = k
f.s = c
f.y = h
f.u = b
b.v = k
b.r = f
l.w = b
l.t = i
l.x = k
c.w = b
c.x = b
c.t = l
assert i.x.r.s.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: A = None
        self.u: C = None
        self.txt = txt

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

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

h = A("h")
i = B("i")
k = C("k")
e = A("e")
j = A("j")
d = A("d")
f = A("f")
b = C("b")
l = B("l")
c = B("c")

h.s = i
h.y = e
h.u = k
i.w = k
i.t = c
i.x = b
k.v = b
k.r = f
e.s = c
e.y = f
e.u = b
j.s = c
j.y = f
j.u = b
d.s = c
d.y = j
d.u = k
f.s = c
f.y = h
f.u = b
b.v = k
b.r = f
l.w = b
l.t = i
l.x = k
c.w = b
c.x = b
c.t = l
assert i.x.r.s.x.v.txt == "k"