class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

c = A("c")
g = B("g")
m = C("m")
d = D("d")
e = E("e")
l = D("l")
a = B("a")
j = E("j")
n = B("n")
h = B("h")

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

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

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

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

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

c = A("c")
g = B("g")
m = C("m")
d = D("d")
e = E("e")
l = D("l")
a = B("a")
j = E("j")
n = B("n")
h = B("h")

c.x = e
c.q = m
c.z = m
g.r = m
g.x = m
g.y = d
g.w = j
m.r = c
m.s = l
m.y = n
d.y = a
d.r = l
d.v = l
d.s = n
e.z = d
e.x = d
e.o = c
l.y = h
l.s = h
l.r = d
l.v = d
a.r = m
a.x = m
a.y = d
a.w = j
j.z = d
j.x = d
j.o = c
n.r = m
n.x = m
n.y = l
n.w = j
h.r = m
h.x = m
h.y = d
h.w = j
assert n.x.r.x.o.x.x.y.y.txt == "d"