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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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