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

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

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

b = A("b")
f = B("f")
k = C("k")
m = B("m")
j = B("j")
a = B("a")
n = B("n")
h = C("h")
e = A("e")

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

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

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

b = A("b")
f = B("f")
k = C("k")
m = B("m")
j = B("j")
a = B("a")
n = B("n")
h = C("h")
e = A("e")

b.x = k
b.o = e
b.w = h
f.w = k
f.u = b
f.x = e
k.v = n
k.s = m
k.q = h
m.w = h
m.u = e
m.x = b
j.w = h
j.u = e
j.x = b
a.w = k
a.u = b
a.x = b
n.w = h
n.u = e
n.x = e
h.v = a
h.s = j
h.q = k
e.x = h
e.o = b
e.w = k
assert b.o.w.s.w.s.u.x.v.txt == "a"