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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.x: C = None
        self.txt = txt

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

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

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