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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: A = None
        self.y: D = None
        self.s: B = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: A = None
        self.r: B = None
        self.p: H = None
        self.txt = txt

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

m.p = g
h.u = j
h.x = j
g.t = d
g.q = m
g.y = c
g.o = c
g.s = h
c.z = f
c.x = m
c.s = m
c.u = j
c.t = h
c.p = i
c.v = k
j.r = l
j.x = k
j.q = m
j.w = i
j.t = h
i.w = m
i.r = f
i.q = c
f.y = j
f.o = j
f.t = j
f.s = g
f.w = g
f.z = c
f.v = l
f.x = d
l.x = g
k.y = g
k.t = m
k.r = h
k.p = l
d.y = g
d.t = m
d.r = h
d.p = l
assert j.t.x.w.w.p.t.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: A = None
        self.y: D = None
        self.s: B = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: A = None
        self.r: B = None
        self.p: H = None
        self.txt = txt

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

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