class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: C = None
        self.z: F = None
        self.v: E = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: A = None
        self.x: A = None
        self.w: B = None
        self.y: F = None
        self.t: F = None
        self.r: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: B = None
        self.q: G = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.u: A = None
        self.z: G = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: D = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: B = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: A = None
        self.x: A = None
        self.w: B = None
        self.y: F = None
        self.t: F = None
        self.r: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: B = None
        self.q: G = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.u: A = None
        self.z: G = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: D = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: B = None
        self.z: D = None
        self.txt = txt

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

g.y = f
g.t = k
g.z = m
g.r = m
g.v = l
f.z = m
f.y = m
f.t = m
f.s = g
f.x = g
f.w = c
f.r = c
k.x = m
k.z = f
k.q = e
k.u = a
k.p = a
b.r = g
b.t = g
b.u = g
b.z = e
b.w = m
l.r = e
l.t = b
l.u = c
l.y = g
m.o = b
m.s = g
m.x = e
e.w = b
e.z = b
e.p = f
a.x = m
a.z = c
a.q = e
a.u = k
a.p = k
c.z = m
c.y = m
c.t = m
c.s = g
c.x = g
c.w = f
c.r = f
assert m.o.w.o.w.x.w.w.txt == "m"