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

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

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

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

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

h = A("h")
k = B("k")
i = C("i")
l = D("l")
b = E("b")
a = B("a")

h.v = l
h.s = a
h.y = b
k.q = a
k.o = b
i.z = l
i.t = l
i.x = h
l.p = h
l.v = h
l.s = h
l.w = b
l.t = b
b.q = i
b.o = k
b.w = h
a.q = k
a.o = b
assert i.t.v.y.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

h = A("h")
k = B("k")
i = C("i")
l = D("l")
b = E("b")
a = B("a")

h.v = l
h.s = a
h.y = b
k.q = a
k.o = b
i.z = l
i.t = l
i.x = h
l.p = h
l.v = h
l.s = h
l.w = b
l.t = b
b.q = i
b.o = k
b.w = h
a.q = k
a.o = b
assert i.t.v.y.o.o.txt == "b"