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

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

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

f = A("f")
c = B("c")
g = C("g")
n = C("n")
h = C("h")
b = B("b")
a = B("a")
k = C("k")
e = A("e")

f.u = e
f.w = a
f.s = c
c.x = f
g.w = h
g.v = c
g.x = a
n.w = k
n.v = c
n.x = c
h.w = g
h.v = b
h.x = b
b.x = e
a.x = f
k.w = h
k.v = a
k.x = b
e.u = f
e.w = c
e.s = a
assert c.x.u.s.x.w.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: B = None
        self.s: B = None
        self.txt = txt

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

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

f = A("f")
c = B("c")
g = C("g")
n = C("n")
h = C("h")
b = B("b")
a = B("a")
k = C("k")
e = A("e")

f.u = e
f.w = a
f.s = c
c.x = f
g.w = h
g.v = c
g.x = a
n.w = k
n.v = c
n.x = c
h.w = g
h.v = b
h.x = b
b.x = e
a.x = f
k.w = h
k.v = a
k.x = b
e.u = f
e.w = c
e.s = a
assert c.x.u.s.x.w.x.u.txt == "e"