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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: A = None
        self.u: C = None
        self.txt = txt

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

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

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

j.s = g
j.t = e
j.u = h
g.v = b
k.x = b
k.u = b
k.o = j
h.w = c
h.q = g
h.o = k
h.z = e
e.q = g
i.s = g
i.t = e
i.u = h
b.x = k
b.u = k
b.o = j
c.w = h
c.q = g
c.o = k
c.z = e
assert g.v.u.o.s.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: E = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: A = None
        self.u: C = None
        self.txt = txt

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

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

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

j.s = g
j.t = e
j.u = h
g.v = b
k.x = b
k.u = b
k.o = j
h.w = c
h.q = g
h.o = k
h.z = e
e.q = g
i.s = g
i.t = e
i.u = h
b.x = k
b.u = k
b.o = j
c.w = h
c.q = g
c.o = k
c.z = e
assert g.v.u.o.s.v.o.txt == "j"