class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: A = None
        self.o: D = None
        self.w: D = None
        self.q: D = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: E = None
        self.s: F = None
        self.t: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: E = None
        self.s: F = None
        self.t: A = None
        self.v: E = None
        self.txt = txt

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

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

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