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

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.x: E = None
        self.u: C = None
        self.t: C = None
        self.txt = txt

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

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

g = A("g")
i = B("i")
e = C("e")
f = D("f")
n = E("n")
b = C("b")
m = B("m")
l = A("l")
h = A("h")

g.v = i
g.x = i
g.q = h
g.y = m
i.t = n
i.r = g
i.u = h
i.o = m
e.w = b
e.y = b
e.u = b
e.t = b
e.x = n
f.z = i
f.x = n
n.x = m
b.w = e
b.y = e
b.u = e
b.t = e
b.x = n
m.t = n
m.r = g
m.u = h
m.o = i
l.v = m
l.q = h
l.y = i
l.x = i
h.v = m
h.y = m
h.x = m
h.q = g
assert e.y.x.x.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: A = None
        self.y: B = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.x: E = None
        self.u: C = None
        self.t: C = None
        self.txt = txt

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

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

g = A("g")
i = B("i")
e = C("e")
f = D("f")
n = E("n")
b = C("b")
m = B("m")
l = A("l")
h = A("h")

g.v = i
g.x = i
g.q = h
g.y = m
i.t = n
i.r = g
i.u = h
i.o = m
e.w = b
e.y = b
e.u = b
e.t = b
e.x = n
f.z = i
f.x = n
n.x = m
b.w = e
b.y = e
b.u = e
b.t = e
b.x = n
m.t = n
m.r = g
m.u = h
m.o = i
l.v = m
l.q = h
l.y = i
l.x = i
h.v = m
h.y = m
h.x = m
h.q = g
assert e.y.x.x.r.x.txt == "i"