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

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

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

c = A("c")
i = B("i")
e = C("e")
h = B("h")
b = A("b")
l = C("l")
j = A("j")
n = A("n")
g = B("g")
a = C("a")

c.x = g
i.y = g
e.t = h
e.o = i
e.r = c
h.y = i
b.x = h
l.t = g
l.o = i
l.r = b
j.x = i
n.x = i
g.y = h
a.t = g
a.o = g
a.r = c
assert e.r.x.y.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

c = A("c")
i = B("i")
e = C("e")
h = B("h")
b = A("b")
l = C("l")
j = A("j")
n = A("n")
g = B("g")
a = C("a")

c.x = g
i.y = g
e.t = h
e.o = i
e.r = c
h.y = i
b.x = h
l.t = g
l.o = i
l.r = b
j.x = i
n.x = i
g.y = h
a.t = g
a.o = g
a.r = c
assert e.r.x.y.y.y.y.y.y.txt == "g"