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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.y: E = None
        self.x: D = None
        self.txt = txt

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

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

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

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

k.p = c
k.s = c
k.v = c
k.q = h
a.t = c
a.x = c
a.o = h
a.y = j
n.x = k
c.u = n
c.r = a
h.v = n
h.x = k
j.v = n
j.x = k
assert k.q.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: D = None
        self.q: E = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.y: E = None
        self.x: D = None
        self.txt = txt

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

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

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

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

k.p = c
k.s = c
k.v = c
k.q = h
a.t = c
a.x = c
a.o = h
a.y = j
n.x = k
c.u = n
c.r = a
h.v = n
h.x = k
j.v = n
j.x = k
assert k.q.v.x.txt == "k"