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

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

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

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

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

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

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

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

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

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

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

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

b.r = l
b.s = l
b.q = k
h.r = j
h.o = k
h.u = l
l.u = h
l.y = h
l.o = h
l.r = h
l.v = k
d.z = h
k.r = b
j.z = h
assert l.o.r.z.txt == "h"