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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.z: G = None
        self.x: B = None
        self.p: D = None
        self.q: E = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: I = None
        self.u: B = None
        self.r: H = None
        self.x: C = None
        self.y: E = None
        self.o: E = None
        self.w: I = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: H = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.z: G = None
        self.x: B = None
        self.p: D = None
        self.q: E = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: I = None
        self.u: B = None
        self.r: H = None
        self.x: C = None
        self.y: E = None
        self.o: E = None
        self.w: I = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: H = None
        self.txt = txt

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

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

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

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

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