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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: I = None
        self.w: I = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: G = None
        self.o: C = None
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: I = None
        self.o: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: I = None
        self.w: I = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: G = None
        self.o: C = None
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: I = None
        self.o: A = None
        self.txt = txt

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

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

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

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