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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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