class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: G = None
        self.y: G = None
        self.o: D = None
        self.x: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: D = None
        self.t: E = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: B = None
        self.v: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: F = None
        self.o: F = None
        self.r: C = None
        self.t: G = None
        self.x: A = None
        self.w: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: D = None
        self.t: E = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: B = None
        self.v: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: F = None
        self.o: F = None
        self.r: C = None
        self.t: G = None
        self.x: A = None
        self.w: G = None
        self.txt = txt

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

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