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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: D = None
        self.r: B = None
        self.o: F = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: C = None
        self.p: C = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.w: D = None
        self.v: G = None
        self.r: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: D = None
        self.r: B = None
        self.o: F = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: C = None
        self.p: C = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.w: D = None
        self.v: G = None
        self.r: F = None
        self.txt = txt

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

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

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