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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: F = None
        self.u: D = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: C = None
        self.p: A = None
        self.o: F = None
        self.t: F = None
        self.z: G = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: D = None
        self.p: C = None
        self.z: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: F = None
        self.u: D = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: C = None
        self.p: A = None
        self.o: F = None
        self.t: F = None
        self.z: G = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: D = None
        self.p: C = None
        self.z: B = None
        self.u: C = None
        self.txt = txt

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

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

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