class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: H = None
        self.u: H = None
        self.z: E = None
        self.v: C = None
        self.r: G = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: F = None
        self.x: D = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: E = None
        self.u: A = None
        self.p: C = None
        self.y: C = None
        self.o: F = None
        self.q: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: H = None
        self.u: H = None
        self.z: E = None
        self.v: C = None
        self.r: G = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: F = None
        self.x: D = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: E = None
        self.u: A = None
        self.p: C = None
        self.y: C = None
        self.o: F = None
        self.q: G = None
        self.txt = txt

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

j.x = n
h.x = g
h.r = g
h.p = c
h.u = c
h.z = b
h.t = b
h.v = m
m.p = l
m.o = h
n.x = m
b.v = j
b.o = m
b.s = c
b.q = c
b.z = g
i.v = g
i.o = n
g.q = n
g.x = n
g.z = i
g.v = i
c.z = l
c.q = n
c.s = m
l.v = i
l.o = i
l.s = b
l.u = j
l.p = m
l.y = m
l.q = g
assert m.p.q.v.o.x.o.v.p.txt == "l"