class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: C = None
        self.r: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: H = None
        self.o: C = None
        self.q: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: B = None
        self.s: F = None
        self.t: E = None
        self.w: H = None
        self.txt = txt

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

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

m.q = b
m.p = b
m.r = f
k.r = d
k.q = d
k.v = d
k.w = b
k.y = n
k.p = n
k.z = m
k.o = f
b.v = f
b.p = d
n.x = k
n.r = d
n.o = b
n.q = i
e.y = f
e.z = f
e.r = f
e.p = d
e.s = d
i.o = e
i.u = k
i.z = n
i.p = f
f.o = d
f.w = d
f.u = k
f.s = i
f.t = e
d.y = e
d.u = i
assert d.u.o.z.s.z.o.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: C = None
        self.r: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: H = None
        self.o: C = None
        self.q: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: B = None
        self.s: F = None
        self.t: E = None
        self.w: H = None
        self.txt = txt

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

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

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