class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: F = None
        self.r: E = None
        self.u: B = None
        self.v: D = None
        self.y: F = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: D = None
        self.w: D = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: A = None
        self.y: G = None
        self.u: A = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: D = None
        self.w: D = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: A = None
        self.y: G = None
        self.u: A = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: B = None
        self.txt = txt

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

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

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