class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: C = None
        self.u: F = None
        self.p: A = None
        self.o: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: C = None
        self.x: C = None
        self.w: F = None
        self.txt = txt

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

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

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

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

i = A("i")
g = B("g")
c = C("c")
a = D("a")
l = E("l")
k = F("k")
b = E("b")
m = A("m")

i.z = k
i.u = k
i.x = c
i.p = m
i.o = m
g.s = a
g.p = c
g.x = c
g.w = k
c.z = a
c.v = g
c.u = b
a.r = l
a.s = l
l.w = a
k.u = g
k.w = a
b.w = a
m.z = k
m.u = k
m.x = c
m.p = i
m.o = i
assert b.w.r.w.s.w.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: C = None
        self.u: F = None
        self.p: A = None
        self.o: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: C = None
        self.x: C = None
        self.w: F = None
        self.txt = txt

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

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

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

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

i = A("i")
g = B("g")
c = C("c")
a = D("a")
l = E("l")
k = F("k")
b = E("b")
m = A("m")

i.z = k
i.u = k
i.x = c
i.p = m
i.o = m
g.s = a
g.p = c
g.x = c
g.w = k
c.z = a
c.v = g
c.u = b
a.r = l
a.s = l
l.w = a
k.u = g
k.w = a
b.w = a
m.z = k
m.u = k
m.x = c
m.p = i
m.o = i
assert b.w.r.w.s.w.r.w.txt == "a"