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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.s: E = None
        self.o: E = None
        self.txt = txt

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

i = A("i")
e = B("e")
b = C("b")
g = D("g")
f = E("f")
a = D("a")
n = B("n")
k = C("k")

i.y = n
i.u = b
i.v = k
e.t = i
e.r = n
e.s = f
b.w = k
b.o = i
g.u = f
g.s = f
g.o = f
g.p = b
f.v = a
f.s = b
a.u = f
a.s = f
a.o = f
a.p = b
n.t = i
n.r = e
n.s = f
k.w = b
k.o = i
assert k.w.w.o.u.o.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: C = None
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.s: E = None
        self.o: E = None
        self.txt = txt

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

i = A("i")
e = B("e")
b = C("b")
g = D("g")
f = E("f")
a = D("a")
n = B("n")
k = C("k")

i.y = n
i.u = b
i.v = k
e.t = i
e.r = n
e.s = f
b.w = k
b.o = i
g.u = f
g.s = f
g.o = f
g.p = b
f.v = a
f.s = b
a.u = f
a.s = f
a.o = f
a.p = b
n.t = i
n.r = e
n.s = f
k.w = b
k.o = i
assert k.w.w.o.u.o.u.o.txt == "i"