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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: E = None
        self.z: A = None
        self.y: E = None
        self.p: G = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: F = None
        self.p: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: D = None
        self.y: H = None
        self.o: E = None
        self.q: A = None
        self.w: D = None
        self.v: B = None
        self.t: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: C = None
        self.u: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: E = None
        self.z: A = None
        self.y: E = None
        self.p: G = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: F = None
        self.p: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: D = None
        self.y: H = None
        self.o: E = None
        self.q: A = None
        self.w: D = None
        self.v: B = None
        self.t: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: C = None
        self.u: D = None
        self.txt = txt

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

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