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

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

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

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

i.u = c
i.o = e
i.w = l
c.o = e
c.s = h
c.r = i
e.q = h
e.v = b
g.o = b
g.s = h
g.r = h
h.u = l
h.o = e
h.w = a
a.o = b
a.s = f
a.r = f
l.o = b
l.s = i
l.r = f
b.q = f
b.v = e
f.u = c
f.o = b
f.w = g
assert e.q.o.q.w.o.v.v.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: C = None
        self.w: B = None
        self.txt = txt

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

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

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

i.u = c
i.o = e
i.w = l
c.o = e
c.s = h
c.r = i
e.q = h
e.v = b
g.o = b
g.s = h
g.r = h
h.u = l
h.o = e
h.w = a
a.o = b
a.s = f
a.r = f
l.o = b
l.s = i
l.r = f
b.q = f
b.v = e
f.u = c
f.o = b
f.w = g
assert e.q.o.q.w.o.v.v.q.u.txt == "c"