class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: C = None
        self.r: B = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: A = None
        self.x: D = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: F = None
        self.u: A = None
        self.z: H = None
        self.w: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: B = None
        self.s: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: A = None
        self.x: D = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: F = None
        self.u: A = None
        self.z: H = None
        self.w: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: B = None
        self.s: B = None
        self.txt = txt

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

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