class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: B = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

a = A("a")
m = B("m")
n = C("n")
b = D("b")
g = E("g")
j = E("j")
i = C("i")

a.v = g
a.s = g
a.t = m
m.w = g
n.o = m
n.u = a
n.x = a
b.v = i
b.y = n
g.s = b
g.t = b
g.x = b
j.s = b
j.t = b
j.x = b
i.o = m
i.u = a
i.x = a
assert a.v.s.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: B = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

a = A("a")
m = B("m")
n = C("n")
b = D("b")
g = E("g")
j = E("j")
i = C("i")

a.v = g
a.s = g
a.t = m
m.w = g
n.o = m
n.u = a
n.x = a
b.v = i
b.y = n
g.s = b
g.t = b
g.x = b
j.s = b
j.t = b
j.x = b
i.o = m
i.u = a
i.x = a
assert a.v.s.y.x.txt == "a"