class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: C = None
        self.x: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: I = None
        self.r: B = None
        self.z: H = None
        self.q: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: G = None
        self.s: G = None
        self.r: B = None
        self.u: F = None
        self.v: F = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: I = None
        self.r: B = None
        self.z: H = None
        self.q: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: G = None
        self.s: G = None
        self.r: B = None
        self.u: F = None
        self.v: F = None
        self.y: D = None
        self.txt = txt

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

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