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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: A = None
        self.p: A = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: A = None
        self.p: A = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: E = None
        self.txt = txt

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

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

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