class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: B = None
        self.r: H = None
        self.q: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: H = None
        self.s: A = None
        self.r: E = None
        self.y: G = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: B = None
        self.u: G = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: D = None
        self.p: G = None
        self.r: C = None
        self.y: B = None
        self.q: D = None
        self.v: A = None
        self.x: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: B = None
        self.p: B = None
        self.q: F = None
        self.v: D = None
        self.txt = txt

j = A("j")
f = B("f")
d = C("d")
i = D("i")
k = E("k")
e = F("e")
n = G("n")
h = H("h")
b = C("b")

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: H = None
        self.s: A = None
        self.r: E = None
        self.y: G = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: B = None
        self.u: G = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: D = None
        self.p: G = None
        self.r: C = None
        self.y: B = None
        self.q: D = None
        self.v: A = None
        self.x: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: B = None
        self.p: B = None
        self.q: F = None
        self.v: D = None
        self.txt = txt

j = A("j")
f = B("f")
d = C("d")
i = D("i")
k = E("k")
e = F("e")
n = G("n")
h = H("h")
b = C("b")

j.s = f
j.p = f
j.r = h
j.q = k
f.q = j
d.p = i
d.o = k
d.u = f
i.q = h
i.v = h
i.s = j
i.r = k
i.p = k
i.y = n
k.p = f
k.z = f
k.u = n
k.r = b
e.o = j
e.v = j
e.t = i
e.q = i
e.x = i
e.p = n
e.r = b
e.y = f
n.p = i
n.z = e
h.u = f
h.s = f
h.p = f
h.q = e
h.v = i
b.p = i
b.o = k
b.u = f
assert k.u.z.y.q.q.u.z.t.txt == "i"