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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: E = None
        self.y: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: E = None
        self.r: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: E = None
        self.y: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: E = None
        self.r: E = None
        self.txt = txt

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

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

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