class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: F = None
        self.p: F = None
        self.r: D = None
        self.s: C = None
        self.o: D = None
        self.x: H = None
        self.y: D = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: H = None
        self.x: A = None
        self.q: E = None
        self.r: H = None
        self.v: I = None
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: A = None
        self.o: C = None
        self.v: C = None
        self.x: G = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: H = None
        self.r: B = None
        self.o: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.q: B = None
        self.w: F = None
        self.s: A = None
        self.u: E = None
        self.p: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: H = None
        self.x: A = None
        self.q: E = None
        self.r: H = None
        self.v: I = None
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: A = None
        self.o: C = None
        self.v: C = None
        self.x: G = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: H = None
        self.r: B = None
        self.o: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.q: B = None
        self.w: F = None
        self.s: A = None
        self.u: E = None
        self.p: E = None
        self.txt = txt

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

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