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

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

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

g = A("g")
k = B("k")
e = C("e")
d = A("d")
h = A("h")
b = A("b")
a = B("a")
l = C("l")

g.y = e
g.v = h
k.q = d
k.u = d
k.y = a
e.u = h
e.o = b
e.t = k
d.y = l
d.v = b
h.y = l
h.v = d
b.y = l
b.v = d
a.q = b
a.y = k
a.u = d
l.u = d
l.o = d
l.t = a
assert g.y.o.v.y.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: A = None
        self.txt = txt

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

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

g = A("g")
k = B("k")
e = C("e")
d = A("d")
h = A("h")
b = A("b")
a = B("a")
l = C("l")

g.y = e
g.v = h
k.q = d
k.u = d
k.y = a
e.u = h
e.o = b
e.t = k
d.y = l
d.v = b
h.y = l
h.v = d
b.y = l
b.v = d
a.q = b
a.y = k
a.u = d
l.u = d
l.o = d
l.t = a
assert g.y.o.v.y.o.v.txt == "b"