class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: D = None
        self.t: B = None
        self.o: C = None
        self.s: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: B = None
        self.q: B = None
        self.u: C = None
        self.p: E = None
        self.txt = txt

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

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

g.v = h
g.t = h
g.w = k
g.s = k
g.o = j
h.p = j
h.r = k
j.s = b
j.q = g
j.o = g
j.t = g
k.x = b
k.p = b
k.y = h
k.q = h
k.u = j
b.s = g
assert g.o.t.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: D = None
        self.t: B = None
        self.o: C = None
        self.s: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: B = None
        self.q: B = None
        self.u: C = None
        self.p: E = None
        self.txt = txt

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

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

g.v = h
g.t = h
g.w = k
g.s = k
g.o = j
h.p = j
h.r = k
j.s = b
j.q = g
j.o = g
j.t = g
k.x = b
k.p = b
k.y = h
k.q = h
k.u = j
b.s = g
assert g.o.t.o.o.txt == "g"