class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: G = None
        self.t: E = None
        self.r: B = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: H = None
        self.w: E = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: B = None
        self.x: F = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: I = None
        self.w: A = None
        self.y: D = None
        self.u: D = None
        self.z: D = None
        self.r: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: H = None
        self.r: A = None
        self.p: E = None
        self.t: G = None
        self.x: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: H = None
        self.w: E = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: B = None
        self.x: F = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: I = None
        self.w: A = None
        self.y: D = None
        self.u: D = None
        self.z: D = None
        self.r: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: H = None
        self.r: A = None
        self.p: E = None
        self.t: G = None
        self.x: F = None
        self.txt = txt

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

m.w = d
m.q = d
m.o = c
m.t = f
m.r = n
n.u = e
n.p = l
n.w = f
n.v = d
e.v = b
e.x = f
e.z = k
b.v = n
b.y = n
b.x = d
b.r = l
i.v = m
i.w = m
i.o = k
i.y = b
i.u = b
i.z = b
i.r = f
d.w = c
d.v = i
d.t = k
c.y = d
c.w = m
l.v = d
l.o = f
l.z = b
l.r = c
l.p = e
l.q = k
k.q = n
k.o = l
k.r = m
k.p = f
k.t = c
k.x = d
f.v = m
f.w = m
f.o = k
f.y = b
f.u = b
f.z = b
f.r = i
assert k.x.t.p.r.r.r.y.x.t.txt == "k"