class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: E = None
        self.v: C = None
        self.z: E = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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