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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

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