class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: B = None
        self.q: C = 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.x: C = None
        self.r: C = None
        self.y: C = None
        self.txt = txt

e = A("e")
a = B("a")
l = C("l")
i = A("i")
b = A("b")
j = C("j")
n = B("n")
m = C("m")

e.y = j
e.r = a
e.q = m
a.o = b
l.x = j
l.r = m
l.y = m
i.y = l
i.r = n
i.q = m
b.y = m
b.q = m
b.r = a
j.x = m
j.r = l
j.y = l
n.o = b
m.x = l
m.y = l
m.r = j
assert i.y.x.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: B = None
        self.q: C = 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.x: C = None
        self.r: C = None
        self.y: C = None
        self.txt = txt

e = A("e")
a = B("a")
l = C("l")
i = A("i")
b = A("b")
j = C("j")
n = B("n")
m = C("m")

e.y = j
e.r = a
e.q = m
a.o = b
l.x = j
l.r = m
l.y = m
i.y = l
i.r = n
i.q = m
b.y = m
b.q = m
b.r = a
j.x = m
j.r = l
j.y = l
n.o = b
m.x = l
m.y = l
m.r = j
assert i.y.x.r.y.txt == "m"