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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: H = None
        self.o: F = None
        self.p: F = None
        self.v: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: H = None
        self.o: F = None
        self.p: F = None
        self.v: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: D = None
        self.u: A = None
        self.txt = txt

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

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