class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: C = None
        self.t: E = None
        self.q: F = None
        self.o: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: B = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

f.u = k
f.z = l
f.t = i
f.o = i
f.q = n
g.z = f
a.v = i
a.s = i
a.y = f
a.x = k
k.q = g
k.x = n
i.u = n
i.p = e
i.w = k
n.w = i
l.v = i
l.s = i
l.y = f
l.x = k
e.z = f
assert l.s.u.w.w.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: C = None
        self.t: E = None
        self.q: F = None
        self.o: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: B = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

f.u = k
f.z = l
f.t = i
f.o = i
f.q = n
g.z = f
a.v = i
a.s = i
a.y = f
a.x = k
k.q = g
k.x = n
i.u = n
i.p = e
i.w = k
n.w = i
l.v = i
l.s = i
l.y = f
l.x = k
e.z = f
assert l.s.u.w.w.x.w.txt == "i"