class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: E = None
        self.r: B = None
        self.s: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

g = A("g")
m = B("m")
h = C("h")
a = D("a")
b = E("b")
i = A("i")
e = D("e")
d = D("d")
j = E("j")

g.x = e
g.v = b
g.r = m
g.s = j
g.o = h
m.z = h
m.y = d
m.v = b
h.r = e
h.s = g
h.o = m
a.w = m
b.r = d
b.v = e
b.t = m
i.x = d
i.v = b
i.s = b
i.r = m
i.o = h
e.w = m
d.w = m
j.r = a
j.v = a
j.t = m
assert g.r.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: E = None
        self.r: B = None
        self.s: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

g = A("g")
m = B("m")
h = C("h")
a = D("a")
b = E("b")
i = A("i")
e = D("e")
d = D("d")
j = E("j")

g.x = e
g.v = b
g.r = m
g.s = j
g.o = h
m.z = h
m.y = d
m.v = b
h.r = e
h.s = g
h.o = m
a.w = m
b.r = d
b.v = e
b.t = m
i.x = d
i.v = b
i.s = b
i.r = m
i.o = h
e.w = m
d.w = m
j.r = a
j.v = a
j.t = m
assert g.r.v.v.txt == "e"