class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: C = None
        self.p: A = None
        self.r: A = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: A = None
        self.r: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: A = None
        self.r: E = None
        self.x: E = None
        self.txt = txt

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

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

k.q = i
k.t = i
k.p = h
k.r = h
k.y = c
j.z = i
j.o = i
j.x = g
i.y = c
i.w = j
i.t = k
c.u = j
c.t = h
c.r = n
c.x = n
n.w = g
n.v = g
n.q = h
g.w = n
g.v = n
g.q = k
h.q = i
h.t = i
h.p = k
h.r = k
h.y = c
assert n.q.y.t.p.p.r.txt == "k"