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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: D = None
        self.w: G = None
        self.p: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: H = None
        self.txt = txt

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

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

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

k.y = g
j.u = k
j.q = b
j.w = e
j.p = e
d.p = h
d.y = m
b.p = j
b.u = k
b.y = d
m.u = d
m.y = d
h.v = d
h.y = a
f.w = b
f.z = a
f.y = h
f.v = j
f.u = m
f.r = k
a.s = j
a.z = g
g.u = d
g.y = d
e.w = b
e.z = a
e.y = h
e.v = j
e.u = g
e.r = k
assert g.y.p.y.z.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: D = None
        self.w: G = None
        self.p: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: H = None
        self.txt = txt

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

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

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

k.y = g
j.u = k
j.q = b
j.w = e
j.p = e
d.p = h
d.y = m
b.p = j
b.u = k
b.y = d
m.u = d
m.y = d
h.v = d
h.y = a
f.w = b
f.z = a
f.y = h
f.v = j
f.u = m
f.r = k
a.s = j
a.z = g
g.u = d
g.y = d
e.w = b
e.z = a
e.y = h
e.v = j
e.u = g
e.r = k
assert g.y.p.y.z.y.p.txt == "h"