class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: D = None
        self.p: B = None
        self.z: F = None
        self.o: C = None
        self.s: F = None
        self.t: H = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: H = None
        self.u: E = None
        self.x: B = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

a = A("a")
g = B("g")
k = C("k")
n = D("n")
f = E("f")
h = F("h")
i = G("i")
j = H("j")

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: H = None
        self.u: E = None
        self.x: B = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

a = A("a")
g = B("g")
k = C("k")
n = D("n")
f = E("f")
h = F("h")
i = G("i")
j = H("j")

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