class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: D = None
        self.x: C = None
        self.t: C = None
        self.q: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: E = None
        self.txt = txt

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

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

h.s = i
h.w = i
h.x = j
h.t = g
h.q = m
c.t = k
c.s = n
l.q = c
i.w = k
i.s = m
m.o = k
m.v = c
m.r = h
m.u = e
n.q = c
j.q = c
k.s = i
k.w = i
k.x = j
k.t = n
k.q = m
g.q = c
e.q = c
assert k.q.r.q.v.s.q.txt == "c"