class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: H = None
        self.q: C = None
        self.v: H = None
        self.w: G = None
        self.p: B = None
        self.o: I = None
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: H = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: B = None
        self.q: A = None
        self.x: F = None
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: E = None
        self.v: G = None
        self.u: I = None
        self.q: I = None
        self.w: H = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: H = None
        self.s: D = None
        self.z: E = None
        self.w: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: G = None
        self.r: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: H = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: B = None
        self.q: A = None
        self.x: F = None
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: E = None
        self.v: G = None
        self.u: I = None
        self.q: I = None
        self.w: H = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: H = None
        self.s: D = None
        self.z: E = None
        self.w: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: G = None
        self.r: D = None
        self.txt = txt

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

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