class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: G = None
        self.x: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: H = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: C = None
        self.o: I = None
        self.u: E = None
        self.x: F = None
        self.q: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: G = None
        self.w: H = None
        self.q: G = None
        self.p: E = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: H = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: C = None
        self.o: I = None
        self.u: E = None
        self.x: F = None
        self.q: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: G = None
        self.w: H = None
        self.q: G = None
        self.p: E = None
        self.t: C = None
        self.txt = txt

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

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