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

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

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

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

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

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

i.x = c
i.v = h
g.w = h
k.v = i
j.y = c
j.v = c
j.w = k
j.r = b
c.t = j
c.o = j
h.w = g
b.y = c
b.v = c
b.w = k
b.r = j
assert b.r.r.r.w.v.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

i.x = c
i.v = h
g.w = h
k.v = i
j.y = c
j.v = c
j.w = k
j.r = b
c.t = j
c.o = j
h.w = g
b.y = c
b.v = c
b.w = k
b.r = j
assert b.r.r.r.w.v.x.t.txt == "j"