class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: D = None
        self.s: B = None
        self.x: I = None
        self.o: C = None
        self.y: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: E = None
        self.o: A = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: A = None
        self.s: F = None
        self.z: B = None
        self.t: H = None
        self.y: H = None
        self.u: G = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: E = None
        self.o: A = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: A = None
        self.s: F = None
        self.z: B = None
        self.t: H = None
        self.y: H = None
        self.u: G = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: G = None
        self.txt = txt

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

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