class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: E = None
        self.w: H = None
        self.z: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: H = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.s: H = None
        self.t: H = None
        self.w: B = None
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: E = None
        self.q: H = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.v: E = None
        self.t: H = None
        self.txt = txt

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

c.x = l
c.r = e
c.w = i
c.z = m
d.u = m
d.p = m
d.w = e
g.v = l
g.u = i
g.q = c
a.v = j
a.s = i
a.t = i
a.w = d
a.o = d
e.z = g
e.o = j
e.x = d
e.u = a
n.q = m
n.s = c
m.z = d
m.p = e
m.q = i
m.w = g
i.z = j
i.t = l
j.u = a
j.p = l
j.v = e
j.t = i
l.u = m
l.p = m
l.w = e
assert n.q.q.z.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: E = None
        self.w: H = None
        self.z: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: H = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.s: H = None
        self.t: H = None
        self.w: B = None
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: E = None
        self.q: H = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.v: E = None
        self.t: H = None
        self.txt = txt

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

c.x = l
c.r = e
c.w = i
c.z = m
d.u = m
d.p = m
d.w = e
g.v = l
g.u = i
g.q = c
a.v = j
a.s = i
a.t = i
a.w = d
a.o = d
e.z = g
e.o = j
e.x = d
e.u = a
n.q = m
n.s = c
m.z = d
m.p = e
m.q = i
m.w = g
i.z = j
i.t = l
j.u = a
j.p = l
j.v = e
j.t = i
l.u = m
l.p = m
l.w = e
assert n.q.q.z.p.p.txt == "m"