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

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

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

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

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

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

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

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

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

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

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

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

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