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

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

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

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

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

a = A("a")
h = B("h")
g = C("g")
f = D("f")
j = E("j")
k = E("k")
c = A("c")
e = E("e")

a.p = h
a.v = h
a.s = f
h.t = j
h.s = k
h.r = f
h.o = c
g.v = h
g.x = e
g.q = e
g.y = a
g.w = c
f.r = k
f.u = h
j.v = f
j.o = f
j.y = f
j.x = h
k.v = f
k.o = f
k.y = f
k.x = h
c.p = h
c.v = h
c.s = f
e.v = f
e.o = f
e.y = f
e.x = h
assert j.x.t.x.s.v.r.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: D = None
        self.v: B = None
        self.txt = txt

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

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

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

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

a = A("a")
h = B("h")
g = C("g")
f = D("f")
j = E("j")
k = E("k")
c = A("c")
e = E("e")

a.p = h
a.v = h
a.s = f
h.t = j
h.s = k
h.r = f
h.o = c
g.v = h
g.x = e
g.q = e
g.y = a
g.w = c
f.r = k
f.u = h
j.v = f
j.o = f
j.y = f
j.x = h
k.v = f
k.o = f
k.y = f
k.x = h
c.p = h
c.v = h
c.s = f
e.v = f
e.o = f
e.y = f
e.x = h
assert j.x.t.x.s.v.r.o.r.txt == "k"