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

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

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

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

b.u = j
b.t = j
b.w = a
c.s = j
c.t = j
c.o = l
l.v = h
l.y = c
l.x = j
a.v = h
a.y = c
a.x = c
h.u = c
h.t = j
h.w = a
j.s = c
j.t = c
j.o = a
assert j.o.y.s.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: B = None
        self.w: C = None
        self.txt = txt

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

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

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

b.u = j
b.t = j
b.w = a
c.s = j
c.t = j
c.o = l
l.v = h
l.y = c
l.x = j
a.v = h
a.y = c
a.x = c
h.u = c
h.t = j
h.w = a
j.s = c
j.t = c
j.o = a
assert j.o.y.s.o.y.txt == "c"