class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
f = C("f")
e = D("e")
j = E("j")
k = E("k")
h = A("h")
n = B("n")
c = C("c")

g.v = l
g.o = h
g.r = e
l.s = c
l.r = n
l.q = e
l.p = e
l.t = f
f.w = e
e.v = k
e.u = h
e.s = g
j.o = k
k.o = j
h.v = l
h.o = g
h.r = e
n.s = c
n.r = l
n.q = e
n.p = e
n.t = f
c.w = e
assert j.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
f = C("f")
e = D("e")
j = E("j")
k = E("k")
h = A("h")
n = B("n")
c = C("c")

g.v = l
g.o = h
g.r = e
l.s = c
l.r = n
l.q = e
l.p = e
l.t = f
f.w = e
e.v = k
e.u = h
e.s = g
j.o = k
k.o = j
h.v = l
h.o = g
h.r = e
n.s = c
n.r = l
n.q = e
n.p = e
n.t = f
c.w = e
assert j.o.o.o.o.txt == "j"