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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: I = None
        self.w: F = None
        self.v: D = None
        self.p: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: E = None
        self.y: B = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: I = None
        self.w: F = None
        self.v: D = None
        self.p: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: E = None
        self.y: B = None
        self.v: F = None
        self.txt = txt

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

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

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

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