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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: C = None
        self.t: B = None
        self.w: D = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: C = None
        self.t: B = None
        self.w: D = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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