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

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

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

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

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

h = A("h")
j = B("j")
l = C("l")
d = D("d")
i = E("i")
c = E("c")

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

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

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

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

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

h = A("h")
j = B("j")
l = C("l")
d = D("d")
i = E("i")
c = E("c")

h.r = d
h.y = j
h.v = j
h.u = l
h.t = c
j.x = c
j.w = c
j.q = d
j.o = d
j.v = l
l.x = d
l.r = j
d.p = h
d.t = h
i.o = c
c.o = i
assert j.q.p.u.r.txt == "j"