class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: B = None
        self.s: C = None
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: E = None
        self.o: E = None
        self.v: F = None
        self.q: E = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: D = None
        self.z: A = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: E = None
        self.o: E = None
        self.v: F = None
        self.q: E = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: D = None
        self.z: A = None
        self.s: B = None
        self.txt = txt

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

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

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