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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

b = A("b")
n = B("n")
e = C("e")
k = C("k")
l = A("l")
a = B("a")
h = C("h")
g = A("g")
m = A("m")
j = B("j")

b.y = n
b.u = g
n.o = g
e.y = b
k.y = g
l.y = j
l.u = b
a.o = g
h.y = l
g.y = a
g.u = l
m.y = j
m.u = l
j.o = m
assert h.y.y.o.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

b = A("b")
n = B("n")
e = C("e")
k = C("k")
l = A("l")
a = B("a")
h = C("h")
g = A("g")
m = A("m")
j = B("j")

b.y = n
b.u = g
n.o = g
e.y = b
k.y = g
l.y = j
l.u = b
a.o = g
h.y = l
g.y = a
g.u = l
m.y = j
m.u = l
j.o = m
assert h.y.y.o.u.u.txt == "b"