class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: G = None
        self.q: F = None
        self.w: E = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: G = None
        self.r: H = None
        self.t: G = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.t: B = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

n.u = e
n.p = e
n.q = i
n.w = m
n.x = j
d.s = i
d.x = e
d.t = e
d.q = e
d.r = f
j.y = i
b.s = k
b.y = n
b.t = d
b.r = m
m.r = e
m.y = j
m.z = b
i.r = m
e.r = m
e.x = f
e.v = b
f.w = l
f.r = m
f.z = b
k.u = e
k.p = e
k.q = i
k.w = m
k.x = j
l.s = n
l.y = k
l.t = d
l.r = m
assert i.r.z.r.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: G = None
        self.q: F = None
        self.w: E = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: G = None
        self.r: H = None
        self.t: G = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.t: B = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

n.u = e
n.p = e
n.q = i
n.w = m
n.x = j
d.s = i
d.x = e
d.t = e
d.q = e
d.r = f
j.y = i
b.s = k
b.y = n
b.t = d
b.r = m
m.r = e
m.y = j
m.z = b
i.r = m
e.r = m
e.x = f
e.v = b
f.w = l
f.r = m
f.z = b
k.u = e
k.p = e
k.q = i
k.w = m
k.x = j
l.s = n
l.y = k
l.t = d
l.r = m
assert i.r.z.r.z.r.txt == "m"