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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: E = None
        self.y: A = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: D = None
        self.u: B = None
        self.z: B = None
        self.txt = txt

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

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

h = A("h")
c = B("c")
j = C("j")
b = D("b")
k = E("k")
i = E("i")
g = A("g")
m = A("m")

h.v = b
h.r = b
h.q = c
h.p = m
h.t = j
c.x = g
c.y = g
c.q = i
c.p = i
j.w = i
j.o = b
j.u = c
j.z = c
b.r = i
k.w = j
k.z = j
k.t = g
k.v = c
i.w = j
i.z = j
i.t = g
i.v = c
g.v = b
g.r = b
g.q = c
g.p = m
g.t = j
m.v = b
m.r = b
m.q = c
m.p = g
m.t = j
assert g.t.o.r.w.o.r.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: B = None
        self.r: D = None
        self.p: A = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: E = None
        self.y: A = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: D = None
        self.u: B = None
        self.z: B = None
        self.txt = txt

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

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

h = A("h")
c = B("c")
j = C("j")
b = D("b")
k = E("k")
i = E("i")
g = A("g")
m = A("m")

h.v = b
h.r = b
h.q = c
h.p = m
h.t = j
c.x = g
c.y = g
c.q = i
c.p = i
j.w = i
j.o = b
j.u = c
j.z = c
b.r = i
k.w = j
k.z = j
k.t = g
k.v = c
i.w = j
i.z = j
i.t = g
i.v = c
g.v = b
g.r = b
g.q = c
g.p = m
g.t = j
m.v = b
m.r = b
m.q = c
m.p = g
m.t = j
assert g.t.o.r.w.o.r.t.t.txt == "j"