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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: B = None
        self.q: B = None
        self.txt = txt

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

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

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

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

k.u = j
i.o = j
i.u = d
i.q = d
f.v = k
f.s = n
f.y = g
f.z = g
g.t = i
g.v = j
g.p = n
g.o = f
j.v = k
j.p = f
d.o = h
d.u = i
d.q = i
n.t = i
n.v = j
n.p = g
n.o = f
h.v = k
h.p = f
assert j.p.s.p.o.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: B = None
        self.q: B = None
        self.txt = txt

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

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

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

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

k.u = j
i.o = j
i.u = d
i.q = d
f.v = k
f.s = n
f.y = g
f.z = g
g.t = i
g.v = j
g.p = n
g.o = f
j.v = k
j.p = f
d.o = h
d.u = i
d.q = i
n.t = i
n.v = j
n.p = g
n.o = f
h.v = k
h.p = f
assert j.p.s.p.o.v.u.txt == "j"