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

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

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

i = A("i")
f = B("f")
d = C("d")
b = B("b")
c = A("c")
h = C("h")
a = C("a")
j = C("j")

i.v = a
i.w = a
i.o = c
f.q = b
d.x = a
d.s = c
d.u = h
b.q = f
c.v = a
c.o = i
c.w = j
h.x = j
h.s = c
h.u = d
a.x = d
a.s = c
a.u = j
j.x = d
j.u = d
j.s = i
assert c.w.x.x.u.u.x.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: A = None
        self.w: C = None
        self.txt = txt

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

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

i = A("i")
f = B("f")
d = C("d")
b = B("b")
c = A("c")
h = C("h")
a = C("a")
j = C("j")

i.v = a
i.w = a
i.o = c
f.q = b
d.x = a
d.s = c
d.u = h
b.q = f
c.v = a
c.o = i
c.w = j
h.x = j
h.s = c
h.u = d
a.x = d
a.s = c
a.u = j
j.x = d
j.u = d
j.s = i
assert c.w.x.x.u.u.x.x.u.txt == "h"