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

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

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

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

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

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

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

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

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

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

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

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

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