class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: B = None
        self.x: A = None
        self.q: G = None
        self.z: E = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: B = None
        self.q: A = None
        self.w: A = None
        self.x: E = None
        self.u: A = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: C = None
        self.u: A = None
        self.r: F = None
        self.s: D = None
        self.p: D = None
        self.txt = txt

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

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

m = A("m")
n = B("n")
d = C("d")
f = D("f")
e = E("e")
l = F("l")
b = G("b")
h = G("h")
a = A("a")
i = A("i")

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: B = None
        self.q: A = None
        self.w: A = None
        self.x: E = None
        self.u: A = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: C = None
        self.u: A = None
        self.r: F = None
        self.s: D = None
        self.p: D = None
        self.txt = txt

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

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

m = A("m")
n = B("n")
d = C("d")
f = D("f")
e = E("e")
l = F("l")
b = G("b")
h = G("h")
a = A("a")
i = A("i")

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