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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: D = None
        self.p: B = None
        self.r: C = None
        self.y: E = None
        self.txt = txt

e = A("e")
i = B("i")
n = C("n")
g = D("g")
a = E("a")
m = F("m")
d = G("d")
l = D("l")
j = B("j")

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: D = None
        self.p: B = None
        self.r: C = None
        self.y: E = None
        self.txt = txt

e = A("e")
i = B("i")
n = C("n")
g = D("g")
a = E("a")
m = F("m")
d = G("d")
l = D("l")
j = B("j")

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