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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: F = None
        self.s: D = None
        self.x: I = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: E = None
        self.s: C = None
        self.t: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: G = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: F = None
        self.s: D = None
        self.x: I = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: E = None
        self.s: C = None
        self.t: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: G = None
        self.t: D = None
        self.txt = txt

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

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

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