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

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

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

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

a.s = j
a.u = e
a.t = c
c.u = l
c.v = g
j.s = c
j.u = e
g.s = j
g.u = j
g.t = c
l.u = h
l.v = g
h.u = l
h.v = g
e.s = c
e.u = j
assert c.u.v.t.v.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: C = None
        self.t: B = None
        self.txt = txt

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

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

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

a.s = j
a.u = e
a.t = c
c.u = l
c.v = g
j.s = c
j.u = e
g.s = j
g.u = j
g.t = c
l.u = h
l.v = g
h.u = l
h.v = g
e.s = c
e.u = j
assert c.u.v.t.v.s.u.txt == "e"