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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: C = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: I = None
        self.u: A = None
        self.v: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: A = None
        self.q: C = None
        self.s: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: C = None
        self.q: D = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: C = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: I = None
        self.u: A = None
        self.v: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: A = None
        self.q: C = None
        self.s: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: C = None
        self.q: D = None
        self.p: E = None
        self.txt = txt

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

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