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

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

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

h = A("h")
n = B("n")
a = C("a")
k = A("k")
e = C("e")
j = B("j")

h.u = n
h.r = n
h.v = e
n.y = h
n.s = j
n.z = j
a.t = k
a.u = k
k.u = n
k.r = n
k.v = a
e.t = k
e.u = h
j.y = k
j.s = n
j.z = n
assert h.r.y.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: B = None
        self.v: C = None
        self.txt = txt

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

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

h = A("h")
n = B("n")
a = C("a")
k = A("k")
e = C("e")
j = B("j")

h.u = n
h.r = n
h.v = e
n.y = h
n.s = j
n.z = j
a.t = k
a.u = k
k.u = n
k.r = n
k.v = a
e.t = k
e.u = h
j.y = k
j.s = n
j.z = n
assert h.r.y.r.y.txt == "h"