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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: C = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: F = None
        self.r: G = None
        self.q: A = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: B = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.x: A = None
        self.y: A = None
        self.z: G = None
        self.v: E = None
        self.r: A = None
        self.q: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: C = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: F = None
        self.r: G = None
        self.q: A = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: B = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.x: A = None
        self.y: A = None
        self.z: G = None
        self.v: E = None
        self.r: A = None
        self.q: G = None
        self.txt = txt

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

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