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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: G = None
        self.t: D = None
        self.p: C = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: C = None
        self.p: E = None
        self.t: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: G = None
        self.t: D = None
        self.p: C = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: C = None
        self.p: E = None
        self.t: D = None
        self.w: C = None
        self.txt = txt

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

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

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